<?php
class Expenditure extends AppModel {
    var $name = 'Expenditure';
    var $primaryKey = 'expenditure_id';
    var $displayField = 'document_number';

    var $belongsTo = array(
        'Building',
        'ExpenditureType',
        'ExpenditureBuildingExpenditureType' => array(
            'className' => 'LookupValue',
            'foreignKey' => 'building_expenditure_type',
            'conditions' => array('ExpenditureBuildingExpenditureType.lookup_type' => 'BUILDING_EXPENDITURE_TYPE'),
            'order' => 'ExpenditureBuildingExpenditureType.meaning'
        ),
        'ExpenditurePaymentMethod' => array(
            'className' => 'LookupValue',
            'foreignKey' => 'payment_method',
            'conditions' => array('ExpenditurePaymentMethod.lookup_type' => 'PAYMENT_METHOD'),
            'order' => 'ExpenditurePaymentMethod.meaning'
        )
    );
}
?>
